﻿{% extends "base_cn.html" %}
{% block title %} -- {{ UserName }}的朋友 {% endblock %}
{% block content %}

  <script language="javascript">
	function OnRefuse()
	{
	    document.form_friend.action='/friend_responsion?responsion=2'; 
            document.form_friend.submit();
        }
  </script>


  <table borderColor=#cccccc cellSpacing=0 cellPadding=3 width="100%" bgColor=#ffffff border=2>

    {% if AcceptFriends %}
    <tr>
	<td valign="top">
	    <p>&nbsp;申请加入的朋友<br></p>
	</td>

	<td valign="top">
	  <form name="form_friend" id="form_friend" action="/friend_responsion?responsion=1" method="post">
	  <table cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0>
	    {% for Item in AcceptFriends %}
	      <tr>
		<td><input type="checkbox" name="acceptitem" value="{{ Item.LoginName }}"></td>
		
		<td>&nbsp;&nbsp;</td>

		<td>
		    <a href="/usershow?item={{ Item.LoginName }}">
		    <img src = "/userphoto?item={{ Item.LoginName }}" width="32px" height="32px" alt="{{ Item.LoginName }}"><br>
		    {{ Item.LoginName }}
		    </a>
		</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{% if Item.ApplyExplain %}{{ Item.ApplyExplain }}{% endif %}</td>
	      </tr>
	    {% endfor %}
	  </table>

	  <div><input type="submit" value="同意">&nbsp;
	  <input type="button" onclick="OnRefuse()" value="拒绝"></div>

	  </form>
	</td>
    </tr>
    {% endif %}


    {% if WaitFriends %}
    <tr>
	<td valign="top">
	    <p>&nbsp;等待对方同意的朋友<br></p>
	</td>

	<td valign="top">
	  <table cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0>
	    {% for Item in WaitFriends %}
	      <tr>
		<td>
		    <a href="/usershow?item={{ Item.FriendName }}">
		    <img src = "/userphoto?item={{ Item.FriendName }}" width="32px" height="32px" alt="{{ Item.FriendName }}"><br>
		    {{ Item.FriendName }}
		    </a>
		</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{% if Item.ApplyExplain %}{{ Item.ApplyExplain }}{% endif %}</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>
	      </tr>
	    {% endfor %}
	  </table>
	</td>
    </tr>
    {% endif %}


    <tr>
	<td valign="top">
	    <p>&nbsp;朋友<br></p>
	</td>

	<td valign="top">
	{% ifequal Tag 'my' %}
	    <form name="form_friend_delete" action="/friend_delete" method="post">
	{% endifequal %}


	  <table cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0>
	    {% for Item in Friends %}
	      <tr>

		{% ifequal Tag 'my' %}
		<td><input type="checkbox" name="deleteitem" value="{{ Item.FriendName }}"></td>
		<td>&nbsp;&nbsp;</td>
		{% endifequal %}

		<td>
		    <a href="/usershow?item={{ Item.FriendName }}">
		    <img src = "/userphoto?item={{ Item.FriendName }}" width="32px" height="32px" alt="{{ Item.FriendName }}"><br>
		    {{ Item.FriendName }}
		    </a>
		</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{% if Item.ApplyExplain %}{{ Item.ApplyExplain }}{% endif %}</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>
	      </tr>
	    {% endfor %}
	  </table>

	{% ifequal Tag 'my' %}
	    {% if Friends %}
		<div align="center"><input type="submit" value="删除"></div>
	    {% endif %}
	    </form>
	{% endifequal %}

	</td>
    </tr>


    {% if RefuseFriends %}
    <tr>
	<td valign="top">
	    <p>&nbsp;被对方拒绝的朋友<br></p>
	</td>

	<td valign="top">
	{% ifequal Tag 'my' %}
	    <form name="form_friend_delete_refuse" action="/friend_delete?responsion=2" method="post">
	{% endifequal %}

	  <table cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0>
	    {% for Item in RefuseFriends %}
	      <tr>

		{% ifequal Tag 'my' %}
		<td><input type="checkbox" name="deleteitem" value="{{ Item.FriendName }}"></td>
		<td>&nbsp;&nbsp;</td>
		{% endifequal %}

		<td>
		    <a href="/usershow?item={{ Item.FriendName }}">
		    <img src = "/userphoto?item={{ Item.FriendName }}" width="32px" height="32px" alt="{{ Item.FriendName }}"><br>
		    {{ Item.FriendName }}
		    </a>
		</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{% if Item.ApplyExplain %}{{ Item.ApplyExplain }}{% endif %}</td>
		
		<td>&nbsp;&nbsp;</td>

		<td>{{ Item.Date|date:" Y-m-j H:i:s" }}</td>
	      </tr>
	    {% endfor %}
	  </table>

	{% ifequal Tag 'my' %}
	    {% if Friends %}
		<div align="center"><input type="submit" value="删除"></div>
	    {% endif %}
	    </form>
	{% endifequal %}

	</td>
    </tr>
    {% endif %}


  </table>

{% endblock %}